<template>
  <div class="dashboard-container" style="font-family:宋体;font-size:35px;color:green;">
    欢迎<br>
    学校个数:{{schoolCount}}<br/> 
    班级个数:{{classsCount}}<br/>
    学生个数:{{studentCount}}<br/>
    老师个数:{{teacherCount}}<br/>  
    学院个数:{{academyCount}}<br/>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },

  data(){
    return{
      schoolCount:'',
      classsCount:'',
      studentCount:'',
      teacherCount:'',
      academyCount:''
    }
  },

  mounted(){
    this.$http.get('/api/users/add').then(res => {
      console.log('this.panels', res)
    })
    this.$http.post('/api/school/find',this.user).then(res =>{
      console.log('res:',res)
      console.log('res:',length)
      this.schoolCount = res.length
    })
    this.$http.post('/api/classs/find',this.user).then(res =>{
      console.log('res:',res)
      console.log('res:',length)
      this.classsCount = res.length
    })
    this.$http.post('/api/student/find',this.user).then(res =>{
      console.log('res:',res)
      console.log('res:'.length)
      this.studentCount = res.length
    })
    this.$http.post('/api/teacher/find',this.user).then(res =>{
      console.log('res:',res)
      console.log('res:'.length)
      this.teacherCount = res.length
    })
    this.$http.post('/api/academy/find',this.user).then(res =>{
      console.log('res:',res)
      console.log('res:'.length)
      this.academyCount = res.length
    })
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
outline-color:greenyellow(123,134,45);
    margin:30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
    color:#e93cb5;
    background-color:peru(65,32,95);
  }
}</style>

<style>

</style>
